<?php

header ( "Content-type:text/html;charset=utf-8" );

$json_string = file_get_contents('../install_sql.json');
$dataxxx = json_decode($json_string, true);
$link=mysqli_connect($dataxxx[1],$dataxxx[2],$dataxxx[3]);//链接数据库

if($link)
{
    $select=mysqli_select_db($link,$dataxxx[4]);//选择数据库
  if($select)
  {
    if(isset($_POST["subl"])||isset($_POST["sub2"]))
    {
      $username=$_POST["username"];
      $password=$_POST["vip"];
      $str="select vip from `OurShareUserName`";
      mysqli_query('SET NAMES UTF8');
	  $result=mysqli_query($link,$str);
      $pass=mysqli_fetch_row($result);
      $pa=$pass[0];
      $sub1=$_POST["sub1"];
      $sub2=$_POST["sub2"];
if($sub1="修改"){
        $sql="UPDATE `OurShareUserName` SET `vip` = '$password' WHERE `OurShareUserName`.`username` = '$username'";//将注册信息插入数据库表中
        echo"$sql";
        mysqli_query($link,$sql);
        mysqli_query('SET NAMES UTF8');
 echo"<script type="."\""."text/javascript"."\"".">"."window.alert"."("."\""."修改成功！"."\"".")".";"."</script>"; echo"<script type="."\""."text/javascript"."\"".">"."window.location="."\""."./user.php"."\""."</script>";
}


     
    }  
  }
}
?>	